<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Spring Boot App</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      margin: 0;
      padding: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    .container {
      max-width: 600px;
      margin: 0 auto;
      background: #fff;
      padding: 20px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      text-align: center;
    }
    h1 {
      color: #333;
    }
    p {
      line-height: 1.6;
    }
    button {
      padding: 10px 20px;
      font-size: 16px;
      color: #fff;
      background-color: #007bff;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }
    button:hover {
      background-color: #0056b3;
    }
  </style>
</head>
<body>
<div class="container">
  <h1>Welcome to My Spring Boot App</h1>
  <p>This is a simple HTML page served by Spring Boot.</p>
  <button id="gitee-login">Gitee授权登录</button>
</div>
<script>
  document.getElementById('gitee-login').addEventListener('click', function() {
    fetch('http://localhost:8080/public/login/gitee/config')
    .then(response => response.json())
    .then(data => {
      const clientId = data.data.clientId;
      const redirectUri = data.data.redirectUri;
      const authUrl = `https://gitee.com/oauth/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=code`;
      window.location.href = authUrl;
    })
    .catch(error => console.error('Error:', error));
  });
</script>
</body>
</html>
